/**

This file is part of MaCI/GIMnet.

MaCI/GIMnet is free software: you can redistribute it and/or modify it 
under the terms of the GNU Lesser General Public License as published 
by the Free Software Foundation, either version 3 of the License, or 
(at your option) any later version.

MaCI/GIMnet is distributed in the hope that it will be useful, but WITHOUT 
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public 
License for more details.

You should have received a copy of the GNU Lesser General Public 
License along with GIMnet. (See COPYING.LESSER) If not, see 
<http://www.gnu.org/licenses/>.

**/
#ifndef TESTOBJECT_H
#define TESTOBJECT_H

#include "Object.h"
#include "Shapes.h"

/** Test object
 * 
 * A simple and useless object that consists of two boxes of different materials
 * connected with a motored hinge. When object hits something, other box's color changes.
 * 
 */
class CTestObject : public CObject
{
  public:
    CTestObject(CWorld *World, float position_x, float position_y);
    
    ~CTestObject();
    
    void Update(float StepSize);
    
    void OnCollision(CPrimitive *primitive, int numc, dContact *contacts, CPrimitive *primitive2);
    
    void Draw();
    
    void Activate();
    

    /** Construct a CTestObject instance from XML.
     *
     * @param[in] world         Pointer to assigned world
     * @param[in] node          Pointer to XML node to start reading from.
     * @return                  Returns pointer which should have been added to World ;)
     */
    static CObject* LoadMLMA(CWorld *world, xmlNode *node);
    
  private:
    TMaterial material1, material2;
    CBox box1, box2;
    
    float motorSpeed;
    dJointID motor;
};

#endif
